package livingarea.Members;

import livingarea.LivingArea;
import livingarea.actions_impl.PrayDeath;
import livingarea.actions_impl.PraySpawn;
import livingarea.actions_impl.SimpleMove;

/**
 * Class that describe a pray fish.
 *
 * @author Muzalevskiy Vitaliy
 */
public class Pray extends Beast {
    
    /**Number of iterations current area member lives.*/
    public static final int DEATH_TIME = 30;
    /**How many moves need area member to do before spawning.*/
    public static final int MOVES_TO_SPAWN = 10;
    
    /**
     * Constructor of current class that create pray in entered living area
     * with random position.
     *
     * @param livingArea - living area in which current pray will be created.
     */
    public Pray(LivingArea livingArea){
        super(livingArea);
        moveType = new SimpleMove(this);
        spawnType = new PraySpawn(this);
        dethType = new PrayDeath(this);
    }
    
    /**
     * Constructor of current class that create fish in entered living area
     * with position values indicated as parameters.
     *
     * @param livingArea - living area in which current pray will be created.
     * @param position - position of current beast.
     */
    public Pray(LivingArea livingArea, Position position){
        super(livingArea, position);
        moveType = new SimpleMove(this);
        spawnType = new PraySpawn(this);
        dethType = new PrayDeath(this);
    }

    @Override
    public void lifeCicle() {
        moveType.move();
        spawnType.spawn();
        dethType.die();
        increaseLifeCount();
    }

    @Override
    public boolean isPray() {
        return true;
    }
}
 